package com.ios.enums;
/**
*@Author:WenTao
*@Description:残疾人用户状态枚举类型
*@Date:10:23 2018/7/17
*/
public enum DisablerStateEnum {
    REPEAT_USERNAME(001,"用户名重复")
    ,REPEAT_PHONE(002,"手机号码重复")
    ,NULL_ERROR(003,"用户信息为空")
    ,ERROR_PASSWORD(004,"用户密码错误")
    ,ERROR_USERNAME(005,"用户不存在")
    ,INNER_ERROR(000,"服务器内部错误")
    ,SUCCESS(1,"操作成功")
    ,PARAM_NULL(006,"请输入完整信息")
    ,PASSWORD_ERROR(007,"两次输入密码不一致")
    ,FAIL(-1,"操作失败");

    private int state;
    private String stateInfo;

    DisablerStateEnum(int state, String stateInfo) {
        this.state = state;
        this.stateInfo = stateInfo;
    }

    /*根据传入的state返回对应的enum值*/
    public static DisablerStateEnum stateof(int state){
        for (DisablerStateEnum stateEnum : values()){
            if (stateEnum.getState() == state){
                return stateEnum;
            }
        }
        return null;
    }

    public int getState() {
        return state;
    }

    public void setState(int state) {
        this.state = state;
    }

    public String getStateInfo() {
        return stateInfo;
    }

    public void setStateInfo(String stateInfo) {
        this.stateInfo = stateInfo;
    }
}
